<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>推送模板测试</h2>
    </div>
    <div class="cf">
        <div class="fl">
            <a class="btn btn-default" href="{:U('pushed/index')}">返回上一层</a>
            <a class="btn btn-default" href="{:U('Pushed/testin')}&id={$_id}&bin={$_bin}">新 增</a>
            <a class="btn btn-default" id="fs" name="fs" data="{$_bin}">发 送</a>
        </div>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">

        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
        <table class="table table-hover">
            <thead>
            <tr>
                <th style="width: 15%">UID</th>
                <th style="width: 25%">nickname</th>
                <th style="width: 25%">openid</th>
                <th style="width: 10%">状态</th>
                <th style="width: 10%">操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                    <tr>
                        <td>{$vo.uid} </td>
                        <td>{$vo.nickname} </td>
                        <td>{$vo.openid}</td>
                        <td>
                            <if condition="($vo.flag == 1)">
                                <span style="color: red;"><b>失效</b></span>
                                <else/>
                                正常
                            </if>
                        </td>
                        <td>
                            <if condition="($vo.flag == 1)">
                                <a href="{:U('Pushed/changeStatus?id='.$vo['id'].'&flag='.$vo['flag'])}" class="confirm ajax-get  btn btn-warning">激活</a>
                                <else/>
                                <a href="{:U('Pushed/changeStatus?id='.$vo['id'].'&flag='.$vo['flag'])}" class="confirm ajax-get  btn btn-warning">失效</a>
                            </if>
                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">
        {$_page}
    </div>

</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <script type="text/javascript">
        highlight_subnav('{:U('Pushed/index')}');

        $('#fs').bind("click", function () {
            var bin = $("#fs").attr("data");
            //bin = "VIPCard0704";
            var url = "http://180.150.187.159:3002/push/2016-05-28/"+bin;

            $.get(url, {},
                    function (data) {
                        alert("发送成功");
                    });
        });

    </script>
</block>